<?php

/** @var $android */
use common\helpers\AddonHelper;

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title><?= $this->title = $setting['title'] ?></title>
    <?= AddonHelper::cssFile('css/weuix.min.css')?>
    <?= AddonHelper::cssFile('css/weui.css')?>
    <?= AddonHelper::cssFile('css/styledrown.css')?>
    <!--zepto类库-->
    <?= AddonHelper::jsFile('js/lib/weui/zepto.min.js')?>
    <!--weui核心库-->
    <?= AddonHelper::jsFile('js/lib/weui/weui.min.js')?>
    <!--逻辑代码-->
    <?= AddonHelper::jsFile('js/main.js')?>
    <style>
        .container2 {
            width: 100%;
            height: 100vh;
            background: rgba(0,0,0,0.8);
            opacity: 0.7;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 99999;
            display: none;
        }
        .text {
            font-size: 1rem;
            font-family:SourceHanSansCN-Medium;
            font-weight: 500;
            color:rgba(254,254,254,1);
            position: fixed;
            top: 11%;
            right: 27%;
        }
        .jump {
            width: 3rem;
            position: fixed;
            right: 12%;
            top: 5.7%;
        }

    </style>
</head>
<body>

<section>
    <div class="container" style="background:url(<?= $setting['background_cover'] ?>)">
        <div class="container2">
            <div class="text">
                <p>点击右上角 · · ·</p>
                <p>在浏览器中打开</p>
            </div>
            <img class="jump" src="<?= AddonHelper::file('img/img01@2x.png')?>" alt="">
        </div>
        <div class="logo">
            <img src="<?= $setting['logo'] ?>" alt="logo" />
        </div>
        <div class="info">
            <h2 class="title"><?= $setting['title']; ?></h2>
            <p class="desc"><i class="desc_bg"></i><?= $setting['tagline']; ?></p>
        </div>
        <div class="btn-group">
            <a href="https://apps.apple.com/cn/app/id<?= $ios['download_url']; ?>">
                <div class="btn btn-ios">
                    <div class="btn-info">
                        <p>iPhone版下载</p>
                        <em>版本 <?= $ios['version']; ?></em>
                    </div>
                </div>
            </a>
            <div class="btn btn-android">
                <div class="btn-info" id="android">
                    <p>Android版下载</p>
                    <em>版本 <?= $android['version']; ?></em>
                </div>
            </div>
        </div>
    </div>
</section>
</body>
</html>

<script>
    $(document).ready(function () {
        var wx = is_weixn();
        console.log(wx);
        if (wx){
            $('.container2').show();
        }
    });

    function is_weixn(){
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            return true;
        } else {
            return false;
        }
    }

    var ua = window.navigator.userAgent.toLowerCase();
    var isIOS =(/(iPhone|iPod|iPad);?/i).test(ua);
    $('#android').click(function () {
        window.location = "<?= $android['download_url'];?>";
    })
</script>